<#assign domain="${ctx.contextPath}" />
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
	<meta name="renderer" content="webkit">
	<title>antiFraud</title>
	<link rel="stylesheet" href="${domain}/static/css/common/bootstrap.min.css">
	<link rel="stylesheet" href="${domain}/static/css/common/base.css">
	<link rel="stylesheet" href="${domain}/static/css/common/header.css">
<link rel="stylesheet" href="${domain}/static/css/antiFraud.css">
	<script src="${domain}/static/js/jquery-3.2.1.slim.min.js"></script>
	<script src="${domain}/static/js/bootstrap.min.js"></script
	<script src="${domain}/static/js/jquery-3.2.1.min.js"></script>
	<script src="${domain}/static/js/bootstrap.min.js"></script>
	 <link rel="stylesheet" href="${domain}/static/css/bootstrap.css">
	  <link rel="stylesheet" href="${domain}/static/css/bootstrapValidator.css">
	 <script src="${domain}/static/js/bootstrapValidator.js"></script>
</head>
<body>
	<!--头部导航-->
	<div class="content">
		<!--侧边导航-->
		<!--反欺诈内容-->
		<div class="anti-fraud">
			<div class="wrap">
				   <form id="defaultForm" method="post" class="form-horizontal" action="${domain}/antifraud/verify?division=2">
                            <h1>请输入以下信息查询</h1>
                        <div class="form-group">
						<input type="text" class="form-control" placeholder="姓名" name="name" id="name">
					</div>
					<div class="form-group">
						<input type="text" class="form-control" placeholder="手机号" name="phone" id="phone">
					</div>
					<div class="form-group">
						<input type="text" class="form-control" placeholder="身份证号" name="idNumber" id="idNumber">
					</div>
					<div class="form-group">
						<input type="text" class="form-control" placeholder="银行卡号" name="cardNumber" id="cardeNumber">
					</div>
					<div class="form-group">
						<input type="text" class="form-control" placeholder="逾借款金额" name="amount" id="amount">
					</div>
					
						<div class="form-group">
							<select class="form-control" name="date" id="dateSelectId">
								<option value="">借款期限</option>
							</select>
						</div>


                         
<div c name="signup">
                                <button name="signup" value="Sign up" class="look" id="signup" type="submit" style="width:300px;margin:0 auto;display:block;">查询</button>
</div>
                    </form>
			</div>
		</div>
	</div>
</body>


  <script type="text/javascript">
   $(document).ready(function() {

    $('#defaultForm').bootstrapValidator({
//        live: 'disabled',
        message: 'This value is not valid',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            name: {
                group: '.form-group',
                validators: {
                    notEmpty: {
                        message: '请输入姓名'
                    },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 10,
                            message: '输入长度过长'
                        }
                }
            },
        phone: {
                group: '.form-group',
                validators: {
                    notEmpty: {
                        message: '请输入手机号'
                    },
                       regexp: {/* 只需加此键值对，包含正则表达式，和提示 */
                            regexp: /^[0-9_\.]+$/,
                            message: '只能是数字和字母_.'
                        },
                        stringLength: {/*长度提示*/
                            min: 11,
                            max: 11,
                            message: '请输入11位数字'
                        }
                }
            },
          idNumber: {
                group: '.form-group',
                validators: {
                    notEmpty: {
                        message: '请输入身份证号'
                    },
                    regexp: {/* 只需加此键值对，包含正则表达式，和提示 */
                            regexp: /^[a-zA-Z0-9_\.]+$/,
                            message: '请输入正确格式'
                        },
                    stringLength: {/*长度提示*/
                            min: 15,
                            max: 20,
                            message: '请输入正确身份证号'
                        }
                }
            },
          cardNumber: {
                group: '.form-group',
                validators: {
                    notEmpty: {
                        message: '请输入银行卡号'
                    },regexp: {/* 只需加此键值对，包含正则表达式，和提示 */
                            regexp: /^[0-9_\.]+$/,
                            message: '只能是数字'
                        },
                        stringLength: {/*长度提示*/
                            min: 10,
                            max: 30,
                            message: '请输入正确银行卡号'
                        }
                }
            },
              amount: {
                group: '.form-group',
                validators: {
                    notEmpty: {
                        message: '请输入预借款金额'
                    },regexp: {
                            regexp: /^[0-9_\.]+$/,
                            message: '只能是数字'
                        },
                        stringLength: {
                            min: 1,
                            max: 15,
                            message: '请输入正确银行卡号'
                        }
                }
            },
              date: {
                group: '.form-group',
                validators: {
                    notEmpty: {
                        message: '请输入预借款金额'
                    },
                        stringLength: {
                            min: 1,
                            max: 10,
                            message: '请输入预借款金额'
                        }
                }
            },

          
        }
    });

$("#signup").click(function(){
 $.ajax({
                cache: true,
                type: "POST",
                url:"../antifraud/cost",
                data:{type:1},// 你的formid
                async: false,
                error: function(request) {
                },
                success: function(data) {
                if(data=='1'){
                  $("#signup").attr("type","");
                alert("余额不足！请联系客服！");
                }
                }
            });
 });
});




 $.ajax({
                cache: true,
                type: "POST",
                url:"${domain}/antifraud/dict",
                data:{type:'stages'},
                async: true,
                error: function(request) {
                },
                success: function(data) {
                for(var i=0;i<data.length;i++){
                 var value=data[i].dictValue;
                $("#dateSelectId").append("<option value='"+value+"'>"+value+"</option>");
                }
               
                }
            });
   
    </script>
</html>